﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace System
{
    public interface IEBaseDAL<T> where T : BaseModel, new()
    {

        int Add(Dictionary<string, T> list, string fields);
        int Add(Dictionary<string, T> list, string fields, string tableName);
        int AddOrModify(Dictionary<string, T> list, string fields);
        int AddOrModify(Dictionary<string, T> list, string fields, string tableName);

        Dictionary<string, T> GetDicList();
        Dictionary<string, T> GetDicList(string sql, List<DBParameter> parameters);
        Dictionary<string, T> GetDicList(string fields, string filter, string sorts, List<DBParameter> parameters);
        Dictionary<string, T> GetDicList(int? pageIndex, int? pageSize, ref int? recordCount, string fields, string filter, string sorts, List<DBParameter> parameters);
        Dictionary<string, T> GetDicList(string tableName);
        Dictionary<string, T> GetDicList(string fields, string filter, string sorts, string tableName, List<DBParameter> parameters);
        Dictionary<string, T> GetDicList(int? pageIndex, int? pageSize, ref int? recordCount, string fields, string filter, string sorts, string tableName, List<DBParameter> parameters);

        int Modify(Dictionary<string, T> list, string fields);
        int Modify(Dictionary<string, T> list, string fields, string tableName);
        int Remove(Dictionary<string, T> list);
        int Remove(Dictionary<string, T> list, string tableName);


        //int _Add<Tm>(Dictionary<string, Tm> list, string fields) where Tm : BaseModel, new();
        //int _Add<Tm>(Dictionary<string, Tm> list, string fields, string tableName) where Tm : BaseModel, new();
        //int _Remove<Tm>(Dictionary<string, Tm> list) where Tm : BaseModel, new();
        //int _Remove<Tm>(Dictionary<string, Tm> list, string tableName) where Tm : BaseModel, new();
        //int _Modify<Tm>(Dictionary<string, Tm> list, string fields) where Tm : BaseModel, new();
        //int _Modify<Tm>(Dictionary<string, Tm> list, string fields, string tableName) where Tm : BaseModel, new();
        //int _AddOrModify<Tm>(Dictionary<string, Tm> list, string fields) where Tm : BaseModel, new();
        //int _AddOrModify<Tm>(Dictionary<string, Tm> list, string fields, string tableName) where Tm : BaseModel, new();
        //Dictionary<string, Tm> _GetDicList<Tm>() where Tm : BaseModel, new();
        //Dictionary<string, Tm> _GetDicList<Tm>(string sql, List<DBParameter> parameters) where Tm : BaseModel, new();
        //Dictionary<string, Tm> _GetDicList<Tm>(string fields, string filter, string sorts, List<DBParameter> parameters) where Tm : BaseModel, new();
        //Dictionary<string, Tm> _GetDicList<Tm>(int? pageIndex, int? pageSize, ref int? recordCount, string fields, string filter, string sorts, List<DBParameter> parameters) where Tm : BaseModel, new();
        //Dictionary<string, Tm> _GetDicList<Tm>(string tableName) where Tm : BaseModel, new();
        //Dictionary<string, Tm> _GetDicList<Tm>(string fields, string filter, string sorts, string tableName, List<DBParameter> parameters) where Tm : BaseModel, new();
        //Dictionary<string, Tm> _GetDicList<Tm>(int? pageIndex, int? pageSize, ref int? recordCount, string fields, string filter, string sorts, string tableName, List<DBParameter> parameters) where Tm : BaseModel, new();
        //Dictionary<string, Tm> _GetDicList<Tm>(IDataReader dr) where Tm : BaseModel, new();
        //Dictionary<string, Tm> _GetDicList<Tm>(DataTable dt) where Tm : BaseModel, new();
        //Dictionary<string, Tm> _GetDicList<Tm>(DataView dv) where Tm : BaseModel, new();
        //Dictionary<string, Tm> _GetDicList<Tm>(SqlInfo sqlInfo, List<DBParameter> parameters) where Tm : BaseModel, new();
        //Dictionary<string, Tm> _GetDicList<Tm>(PageInfo pageInfo, List<DBParameter> parameters) where Tm : BaseModel, new();
    }
}
